package com.nd.rj.common.login.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 发送手机短信验证码请求Bean <br>
 * Created 2014-9-9 下午4:54:56
 * 
 * @version
 * @author gpy
 * 
 * @see
 * 
 *      Copyright(c) 2009-2014, TQ Digital Entertainment, All Rights Reserved
 * 
 */

public class SendCodeBean implements ISendCodeBean {

    /** 用户ID 用户ID和用户名二选一 */
    private long mUid;
    /** 用户名 用户ID和用户名二选一 */
    private String mUsername;
    /** 手机号码，必须，11位整型 */
    private String mPhone;
    /** 短信验证码类型(这边填1) 99帐号中心发短信传1，必须 （注意：不再支持值2,3） */
    private int mType;
    /** 业务类型(这边填11) 必须 0=手机绑定申请发送校验码new， 1=校验旧手机号发送校验码new，2=校验新手机号发送校验码new，11=手机取回密码发送校验码 */
    private int mBtype;
    /** 密码，绑定/改绑时必须，重设时不用 */
    private String mPassword;
    /** 加密方式，选填，0=不加密，1=rsa加密，默认0 */
    private int mEncrypt;
    /** 旧手机验证码，改绑时必须传 */
    private String mOldcode;

    @Override
    public long getUid() {
        return mUid;
    }

    @Override
    public void setUid(long uid) {
        this.mUid = uid;
    }

    @Override
    public String getUsername() {
        return mUsername;
    }

    @Override
    public void setUsername(String username) {
        this.mUsername = username;
    }

    @Override
    public String getPhone() {
        return mPhone;
    }

    @Override
    public void setPhone(String phone) {
        this.mPhone = phone;
    }

    @Override
    public int getType() {
        return mType;
    }

    @Override
    public void setType(int type) {
        this.mType = type;
    }

    @Override
    public int getBtype() {
        return mBtype;
    }

    @Override
    public void setBtype(int btype) {
        this.mBtype = btype;
    }

    @Override
    public String getPassword() {
        return mPassword;
    }

    @Override
    public void setPassword(String password) {
        this.mPassword = password;
    }

    @Override
    public int getEncrypt() {
        return mEncrypt;
    }

    @Override
    public void setEncrypt(int encrypt) {
        this.mEncrypt = encrypt;
    }

    @Override
    public String getOldcode() {
        return mOldcode;
    }

    @Override
    public void setOldcode(String oldcode) {
        this.mOldcode = oldcode;
    }

    /**
     * 定义一个默认的构造函数 Created 2014-9-9 16:48:4
     */
    public SendCodeBean() {

    }

    /**
     * 序列化需要的构造函数 Created 2014-9-9 16:48:4
     * 
     * @param parcel
     *            序列化
     */
    private SendCodeBean(Parcel parcel) {
        this.mUid = parcel.readLong();
        this.mUsername = parcel.readString();
        this.mPhone = parcel.readString();
        this.mType = parcel.readInt();
        this.mBtype = parcel.readInt();
        this.mPassword = parcel.readString();
        this.mEncrypt = parcel.readInt();
        this.mOldcode = parcel.readString();
    }

    public static final Parcelable.Creator<SendCodeBean> CREATOR = new Parcelable.Creator<SendCodeBean>() {

        @Override
        public SendCodeBean createFromParcel(Parcel in) {
            return new SendCodeBean(in);

        }

        @Override
        public SendCodeBean[] newArray(int size) {
            return new SendCodeBean[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(mUid);
        dest.writeString(mUsername);
        dest.writeString(mPhone);
        dest.writeInt(mType);
        dest.writeInt(mBtype);
        dest.writeString(mPassword);
        dest.writeInt(mEncrypt);
        dest.writeString(mOldcode);
    }
}
